﻿@model JTWEB3.Views.News.IndexModel

@{
    ViewData["Title"] = "动态新闻";
}




<div class="row">
    <div class="col-sm-2">
        <div class="list-group side-bar">
            @if (Model.NewsClassifyList.code == 200)
            {
                @foreach (var m in Model.NewsClassifyList.data)
                {
                    <a class="list-group-item list-group-item-action" data-toggle="tab" href="#news">
                        @m.Name
                    </a>
                }
            }
        </div>
    </div>
    <div class="col-sm-7">
        <div class="news-list container tab-pane active" id="news">
            @foreach (var m in Model.NewsList.data)
            {
                <div class="news-list-item row one-news">
                    <div class="col-sm-5"> <img src="@m.Image" class="card-img" alt="News Image" /></div>

                    <div class="col-sm-7">

                        <a asp-controller="News" asp-action="Details" asp-route-id="@m.Id" class="title">@m.Title </a>
                        <div style="text-overflow:ellipsis;">
                            <p>@m.Contents</p>
                        </div>
                        <div class="info">
                            <ul>
                                <li>
                                    <span class="avatar"><img src="~/images/user.svg" /></span>
                                    <span>匿名</span>
                                </li>
                                <li>
                                    <span class="avatar">
                                        <img src="~/images/like.svg" data-toggle="tooltip"
                                             data-placement="top" title="点赞数量：@m.CommentCount" />
                                    </span>
                                    <span> @m.CommentCount </span>
                                </li>
                                <li>
                                    <span class="avatar">
                                        <img src="~/images/Remark.svg" data-toggle="tooltip"
                                             data-placement="top" title="评论数量：@m.CommentCount" />
                                    </span>
                                    <span> @m.CommentCount</span>
                                </li>
                                <li>
                                    <span class="avatar">
                                        <img src="~/images/time.svg" data-toggle="tooltip"
                                             data-placement="top" title="评论时间：@m.PublishDate" />
                                    </span>

                                    <span>@m.PublishDate</span>
                                </li>
                            </ul>

                        </div>

                    </div>

                </div>
            }
        </div>
    </div>
    <div class="col-sm-3">
        <div class="search-bar">
            <input type="search" class="form-control" name="name" placeholder="搜索资讯" />
        </div>
        <div class="side-bar-card flag clearfix">
            <a href="http://www.12377.cn/"> <img src="~/images/21-1.jpg" /></a>
        </div>
        <div class="side-bar-card">
            <div class="card-title">24小时热闻</div>
            <div class="card-body">
                <div class="list">
                    @foreach (var m in Model.HotNewsList.data)
                    {
                        <div class="item">
                            <div class="title">
                                @m.Title

                                @if (!string.IsNullOrEmpty(m.Badge))
                                {
                                    <span class="badge badge-success">@m.Badge </span>
                                }
                                @if (!string.IsNullOrEmpty(m.Hot))
                                {
                                    <span class="badge badge-success">@m.Hot </span>
                                }




                            </div>
                            <div class="desc">@m.CommentCount 评论</div>
                        </div>
                    }
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(document).ready(function(){
    $('[data-toggle="tooltip"]').tooltip(); 
});
</script>
